package com.sg.service.base.app.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sg.common.util.CommonFunctionHelper;
import com.sg.dto.base.app.req.*;
import com.sg.entity.OmsRealTimeSchedulingOperationRecord;
import com.sg.service.base.app.MOmsRealTimeSchedulingOperationRecordService;
import com.wicket.okrapp.common.dto.FieldInfo;
import com.wicket.okrapp.common.exception.BizException;
import com.wicket.okrapp.dal.mapper.mbg.OmsRealTimeSchedulingOperationRecordMapper;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author ：
 * @version 1.0
 * @since 2022/1/19 15:39
 */
@Service
public class MOmsRealTimeSchedulingOperationRecordServiceImpl
        extends ServiceImpl<OmsRealTimeSchedulingOperationRecordMapper, OmsRealTimeSchedulingOperationRecord>
        implements MOmsRealTimeSchedulingOperationRecordService {

    @Autowired
    OmsRealTimeSchedulingOperationRecordMapper omsRealTimeSchedulingOperationRecordMapper;

    /**
     * 3-14-01查询批次统一管理部门列表[5013]
     * gen by moon at 10/27/2022, 5:12:53 AM
     */
    @Trace(operationName = "3-14-01查询批次统一管理部门列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsRealTimeSchedulingOperationRecord> queryBatchUnifiedMgtDeptList(QueryBatchUnifiedMgtDeptListReq reqDto) {

        try {
            QueryWrapper<OmsRealTimeSchedulingOperationRecord> queryWrapper = new QueryWrapper<>();


            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsRealTimeSchedulingOperationRecord.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsRealTimeSchedulingOperationRecord.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsRealTimeSchedulingOperationRecord.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsRealTimeSchedulingOperationRecord>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-14-01新增批次统一管理部门[5014]
     * gen by moon at 10/27/2022, 5:12:53 AM
     */
    @Trace(operationName = "3-14-01新增批次统一管理部门")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String addBatchUnifiedMgtDept(OmsRealTimeSchedulingOperationRecord omsRealTimeSchedulingOperationRecord) {
        omsRealTimeSchedulingOperationRecord.setUnifiedManagementRecordId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
        omsRealTimeSchedulingOperationRecord.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsRealTimeSchedulingOperationRecord.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsRealTimeSchedulingOperationRecord.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
        omsRealTimeSchedulingOperationRecord.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
        if (super.save(omsRealTimeSchedulingOperationRecord)) {
            return omsRealTimeSchedulingOperationRecord.getUnifiedManagementRecordId();
        } else {
            return "-1";
        }

    }

    /**
     * 3-14-01删除批次统一管理部门[5015]
     * gen by moon at 10/27/2022, 5:12:54 AM
     */
    @Trace(operationName = "3-14-01删除批次统一管理部门")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean deleteBatchUnifiedMgtDept(String unifiedManagementRecordId) {

        return super.removeById(unifiedManagementRecordId);
    }

    /**
     * 3-14-01查询批次统一管理部门详情[5026]
     * gen by moon at 3/30/2023, 12:39:28 PM
     */
    @Trace(operationName = "3-14-01查询批次统一管理部门详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsRealTimeSchedulingOperationRecord queryBatchUnifiedMgtDeptDetail(QueryBatchUnifiedMgtDeptDetailReq reqDto) {

        try {

            QueryWrapper<OmsRealTimeSchedulingOperationRecord> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsRealTimeSchedulingOperationRecord> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsRealTimeSchedulingOperationRecord retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-14-01批量删批次统一管理部门[5016]
     * gen by moon at 10/27/2022, 4:09:02 PM
     */
    @Trace(operationName = "3-14-01批量删批次统一管理部门")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchDeleteBatchUnifiedMgtDept(List<String> reqDto) {

        if (reqDto == null || reqDto.size() == 0) {
            return false;
        }

        return super.removeByIds(reqDto);
    }

    /**
     * 3-14-01批量查询批次统一管理部门[5051]
     * gen by moon at 11/3/2022, 10:56:43 PM
     */
    @Trace(operationName = "3-14-01批量查询批次统一管理部门")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsRealTimeSchedulingOperationRecord> batchQueryBatchUnifiedMgtDept(BatchQueryBatchUnifiedMgtDeptReq reqDto) {

        try {
            QueryWrapper<OmsRealTimeSchedulingOperationRecord> queryWrapper = new QueryWrapper<>();

            if (reqDto.getBatchUnifiedMgtDeptList() == null || reqDto.getBatchUnifiedMgtDeptList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("mgt_object_id", reqDto.getBatchUnifiedMgtDeptList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsRealTimeSchedulingOperationRecord.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsRealTimeSchedulingOperationRecord.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsRealTimeSchedulingOperationRecord.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsRealTimeSchedulingOperationRecord>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M3查询下发影响管理的部门测试列表[5113]
     * gen by moon at 11/4/2022, 2:09:34 AM
     */
    @Trace(operationName = "M3查询下发影响管理的部门测试列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsRealTimeSchedulingOperationRecord> queryIssuingDeptMgtTestDataList(QueryIssuingDeptMgtTestDataListReq reqDto) {

        try {
            QueryWrapper<OmsRealTimeSchedulingOperationRecord> queryWrapper = new QueryWrapper<>();


            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsRealTimeSchedulingOperationRecord.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsRealTimeSchedulingOperationRecord.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsRealTimeSchedulingOperationRecord.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsRealTimeSchedulingOperationRecord>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M3批量删下发影响管理的部门测试[5114]
     * gen by moon at 11/4/2022, 2:09:34 AM
     */
    @Trace(operationName = "M3批量删下发影响管理的部门测试")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchDeleteIssuingDeptMgtTestData(List<String> reqDto) {

        if (reqDto == null || reqDto.size() == 0) {
            return false;
        }

        return super.removeByIds(reqDto);
    }

    /**
     * 3-14-01批量改批次统一管理部门[5744]
     * gen by moon at 1/19/2023, 9:09:05 PM
     */
    @Trace(operationName = "3-14-01批量改批次统一管理部门")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchUpdateBatchUnifiedMgtDept(List<OmsRealTimeSchedulingOperationRecord> omsRealTimeSchedulingOperationRecord) {

        if (omsRealTimeSchedulingOperationRecord == null || omsRealTimeSchedulingOperationRecord.size() == 0) {
            return false;
        }
        return super.saveOrUpdateBatch(omsRealTimeSchedulingOperationRecord);

    }

    /**
     * 3-14-01新增实时调度操作记录[5014]
     * gen by moon at 4/20/2023, 11:18:00 PM
     */
    @Trace(operationName = "3-14-01新增实时调度操作记录")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public String addRealTimeSchedulingOperationRecord(OmsRealTimeSchedulingOperationRecord omsRealTimeSchedulingOperationRecord) {
        omsRealTimeSchedulingOperationRecord.setUnifiedManagementRecordId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
        omsRealTimeSchedulingOperationRecord.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsRealTimeSchedulingOperationRecord.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        omsRealTimeSchedulingOperationRecord.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
        omsRealTimeSchedulingOperationRecord.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
        if (super.save(omsRealTimeSchedulingOperationRecord)) {
            return omsRealTimeSchedulingOperationRecord.getUnifiedManagementRecordId();
        } else {
            return "-1";
        }

    }

    /**
     * 3-14-01批量增实时调度操作记录[6334]
     * gen by moon at 4/20/2023, 11:18:01 PM
     */
    @Trace(operationName = "3-14-01批量增实时调度操作记录")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchAddRealTimeSchedulingOperationRecord(List<OmsRealTimeSchedulingOperationRecord> omsRealTimeSchedulingOperationRecord) {

        if (omsRealTimeSchedulingOperationRecord == null || omsRealTimeSchedulingOperationRecord.size() == 0) {
            return false;
        }

        return super.saveBatch(omsRealTimeSchedulingOperationRecord.stream().map(item -> {
            item.setUnifiedManagementRecordId(CommonFunctionHelper.getUid());//DISTRIBUTED_ID
            item.setCreateInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
            item.setCreateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
            item.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            item.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID
            return item;
        }).collect(Collectors.toList()));
    }

    /**
     * 3-14-01查询实时调度操作记录详情[6344]
     * gen by moon at 4/22/2023, 3:48:13 PM
     */
    @Trace(operationName = "3-14-01查询实时调度操作记录详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsRealTimeSchedulingOperationRecord queryRealTimeSchedulingOperationRecordDetail(QueryRealTimeSchedulingOperationRecordDetailReq reqDto) {

        try {
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSceneId());//CURRENT_SCENEID
            QueryWrapper<OmsRealTimeSchedulingOperationRecord> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsRealTimeSchedulingOperationRecord> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsRealTimeSchedulingOperationRecord retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-14-01批量查询实时调度操作记录[6345]
     * gen by moon at 4/22/2023, 3:48:17 PM
     */
    @Trace(operationName = "3-14-01批量查询实时调度操作记录")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsRealTimeSchedulingOperationRecord> batchQueryRealTimeSchedulingOperationRecord(BatchQueryRealTimeSchedulingOperationRecordReq reqDto) {

        try {
            QueryWrapper<OmsRealTimeSchedulingOperationRecord> queryWrapper = new QueryWrapper<>();
            reqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID
            if (reqDto.getRealTimeSchedulingOperationRecordList() == null || reqDto.getRealTimeSchedulingOperationRecordList().isEmpty()) {
                return new ArrayList<>();
            }
            queryWrapper.in("entity_id", reqDto.getRealTimeSchedulingOperationRecordList());
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsRealTimeSchedulingOperationRecord.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsRealTimeSchedulingOperationRecord.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsRealTimeSchedulingOperationRecord.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsRealTimeSchedulingOperationRecord>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M3查询实时调度操作记录测试列表[6366]
     * gen by moon at 4/26/2023, 12:23:48 AM
     */
    @Trace(operationName = "M3查询实时调度操作记录测试列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsRealTimeSchedulingOperationRecord> queryRealTimeSchedulingOperationRecordTestList(OmsRealTimeSchedulingOperationRecord omsRealTimeSchedulingOperationRecord) {

        try {
            QueryWrapper<OmsRealTimeSchedulingOperationRecord> queryWrapper = new QueryWrapper<>();


            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(omsRealTimeSchedulingOperationRecord);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsRealTimeSchedulingOperationRecord.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsRealTimeSchedulingOperationRecord.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsRealTimeSchedulingOperationRecord.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsRealTimeSchedulingOperationRecord>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M3批量删实时调度操作记录测试[6367]
     * gen by moon at 4/26/2023, 12:23:51 AM
     */
    @Trace(operationName = "M3批量删实时调度操作记录测试")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchDeleteRealTimeSchedulingOperationRecordTest(List<String> reqDto) {

        if (reqDto == null || reqDto.size() == 0) {
            return false;
        }

        return super.removeByIds(reqDto);
    }

    /**
     * M3查询统一管理部门测试详情[6394]
     * gen by moon at 4/30/2023, 10:58:18 PM
     */
    @Trace(operationName = "M3查询统一管理部门测试详情")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public OmsRealTimeSchedulingOperationRecord queryUnifyMgtDeptTestDetail(QueryUnifyMgtDeptTestDetailReq reqDto) {

        try {

            QueryWrapper<OmsRealTimeSchedulingOperationRecord> queryWrapper = new QueryWrapper<>();
            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, new ArrayList<>());
            queryWrapper.orderByDesc("create_time");
            List<OmsRealTimeSchedulingOperationRecord> retList = super.list(queryWrapper);
            if (retList != null && retList.size() > 0) {
                OmsRealTimeSchedulingOperationRecord retData = retList.get(0);

                return retData;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * M3删除统一管理部门测试[6395]
     * gen by moon at 4/30/2023, 10:58:20 PM
     */
    @Trace(operationName = "M3删除统一管理部门测试")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean deleteUnifyMgtDeptTest(String unifiedManagementRecordId) {

        return super.removeById(unifiedManagementRecordId);
    }

    /**
     * 3-14-01查询实时调度操作记录列表[6406]
     * gen by moon at 5/1/2023, 2:15:00 PM
     */
    @Trace(operationName = "3-14-01查询实时调度操作记录列表")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<OmsRealTimeSchedulingOperationRecord> queryRealTimeSchedulingOperationRecordList(QueryRealTimeSchedulingOperationRecordListReq reqDto) {

        try {
            QueryWrapper<OmsRealTimeSchedulingOperationRecord> queryWrapper = new QueryWrapper<>();


            Map<String, Object> fieldInfoMap = null;
            fieldInfoMap = CommonFunctionHelper.objectToMapForLamBda(reqDto);
            List<FieldInfo> compareList = CommonFunctionHelper.getRangeField(OmsRealTimeSchedulingOperationRecord.class);
            CommonFunctionHelper.buildQueryWrapperCompare(queryWrapper, compareList, fieldInfoMap);
            List<FieldInfo> likeList = CommonFunctionHelper.getLikeFiled(OmsRealTimeSchedulingOperationRecord.class);
            CommonFunctionHelper.buildQueryWrapperLike(queryWrapper, likeList, fieldInfoMap);
            likeList.addAll(compareList);
            CommonFunctionHelper.buildQueryWrapperEq(queryWrapper, fieldInfoMap, likeList);
            List<FieldInfo> orderList = CommonFunctionHelper.getOrderList(OmsRealTimeSchedulingOperationRecord.class);
            //CommonFunctionHelper.buildQueryWrapperOrder(queryWrapper, orderList);

            return ((List<OmsRealTimeSchedulingOperationRecord>) super.list(queryWrapper));
        } catch (Exception e) {
            e.printStackTrace();
            throw new BizException("-1", e, false);
        }
    }

    /**
     * 3-14-01批量删实时调度操作记录[6407]
     * gen by moon at 5/1/2023, 2:15:03 PM
     */
    @Trace(operationName = "3-14-01批量删实时调度操作记录")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchDeleteRealTimeSchedulingOperationRecord(List<String> reqDto) {

        if (reqDto == null || reqDto.size() == 0) {
            return false;
        }

        return super.removeByIds(reqDto);
    }

}

